/*
#
#  Copyright 2011 Matthew Jannace
#
#  This file is part of RoboCode BlackHoleAgent
#
#  RoboCode BlackHoleAgent is free software: you can redistribute it and/or
#  modify it under the terms of the GNU General Public License as
#  published by the Free Software Foundation, either version 3 of the
#  License, or (at your option) any later version.
#
#  RoboCode BlackHoleAgent is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with RoboCode BlackHoleAgent. If not, see
#  <http://www.gnu.org/licenses/>.
#
 */
package com.jannaceltd.TeamBlackHoleBeer.Modules.HelperClasses;

import com.jannaceltd.TeamBlackHoleBeer.BlackHole_Abstract;
import java.awt.geom.Point2D;
import java.io.Serializable;

/**
 * Class for storing Information about the Current Robots information
 * @author Matthew Jannace <mjannace@gmail.com>
 * @version 1.0
 */
public class BotDetails extends Robots implements Serializable {

    private static final long serialVersionUID = 5890963822395906392L;
    private double BattleFieldHeight;
    private double BattleFieldWidth;

    /**
     * Creates a BotDetails Object
     */
    public BotDetails() {
        this.name = "";
        this.energy = 0.0;
        this.alive = true;
        this.pos = new Point2D.Double();
        this.bearing = 0.0;
        this.heading = 0.0;
        this.velocity = 0.0;
        this.distance = 0.0;
        this.changehead = 0.0;
        this.ctime = 0L;
    }

    /**
     * Creates a BotDetails Object
     * @param Agent
     */
    public BotDetails(BlackHole_Abstract Agent) {
        this.name = "";
        this.energy = 0.0;
        this.alive = true;
        this.pos = new Point2D.Double((Agent.getBattleFieldWidth() / 2), (Agent.getBattleFieldHeight() / 2));
        this.bearing = 0.0;
        this.heading = 0.0;
        this.velocity = 0.0;
        this.distance = 0.0;
        this.changehead = 0.0;
        this.ctime = 0L;
    }

    /**
     * Creates a BotDetails Object
     * @param tm
     * @param BattleFieldHeight
     * @param BattleFieldWidth
     */
    public BotDetails(TeamMate tm, double BattleFieldHeight, double BattleFieldWidth) {
        this.name = tm.getName();
        this.energy = tm.getEnergy();
        this.alive = tm.getAlive();
        this.pos = tm.getPos();
        this.bearing = tm.getBearingRadians();
        this.heading = tm.getHeadingRadians();
        this.velocity = tm.getVelocity();
        this.distance = tm.getDistance();
        this.changehead = tm.changehead;
        this.ctime = tm.getCtime();
        this.BattleFieldHeight = BattleFieldHeight;
        this.BattleFieldWidth = BattleFieldWidth;
    }

    /**
     * Creates a BotDetails Object
     * @param name
     * @param energy
     * @param alive
     * @param pos
     * @param bearing
     * @param heading
     * @param velocity
     * @param distance
     * @param changehead
     * @param ctime
     */
    public BotDetails(
            String name,
            double energy,
            boolean alive,
            Point2D.Double pos,
            double bearing,
            double heading,
            double velocity,
            double distance,
            double changehead,
            long ctime) {
        this.name = name;
        this.energy = energy;
        this.alive = alive;
        this.pos = new Point2D.Double(pos.getX(), pos.getY());
        this.bearing = bearing;
        this.heading = heading;
        this.velocity = velocity;
        this.distance = distance;
        this.changehead = changehead;
        this.ctime = ctime;
    }

    /**
     * Creates a BotDetails Object
     * @param tm 
     */
    public BotDetails(TeamMate tm) {
        this.name = tm.getName();
        this.energy = tm.getEnergy();
        this.alive = tm.getAlive();
        this.pos = tm.getPos();
        this.bearing = tm.getBearingRadians();
        this.heading = tm.getHeadingRadians();
        this.velocity = tm.getVelocity();
        this.distance = tm.getDistance();
        this.changehead = tm.changehead;
        this.ctime = tm.getCtime();
    }

    /**
     * Gets the Battle Field Height
     * @return BattleFieldHeight
     */
    public double getBattleFieldHeight() {
        return BattleFieldHeight;
    }

    /**
     * Sets the Battle Field Height
     * @param BattleFieldHeight 
     */
    public void setBattleFieldHeight(double BattleFieldHeight) {
        this.BattleFieldHeight = BattleFieldHeight;
    }

    /**
     * Gets the Battle Field Width
     * @return BattleFieldWidth
     */
    public double getBattleFieldWidth() {
        return BattleFieldWidth;
    }

    /**
     * Sets the Battle Field Width
     * @param BattleFieldWidth
     */
    public void setBattleFieldWidth(double BattleFieldWidth) {
        this.BattleFieldWidth = BattleFieldWidth;
    }

    /**
     * Returns String representing the object
     * @return String Name and XY locations
     */
    @Override
    public String toString() {
        return "Name = " + name
                + ", X = " + pos.x
                + ", Y = " + pos.y;
    }
}
